home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / ww0654.zip / WW0654.TXT
Text File  |  1992-12-23  |  45KB  |  1,063 lines

  1. ======================================================================
  2.   Microsoft(R) Product Support Services Application Note (Text File)
  3.              WW0654: WINDOWS 3.1 AND SERIAL COMMUNICATIONS
  4. ======================================================================
  5.                                                   Revision Date: 10/92
  6.                                                       No Disk Included
  7.  
  8. The following information applies to Microsoft Windows(TM) version
  9. 3.1.
  10.  
  11.  --------------------------------------------------------------------
  12. | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
  13. | ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
  14. | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
  15. | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
  16. | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
  17. | PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
  18. | accuracy and the use of this Application Note. This Application    |
  19. | Note may be copied and distributed subject to the following        |
  20. | conditions: 1) All text must be copied without modification and    |
  21. | all pages must be included; 2) If software is included, all files  |
  22. | on the disk(s) must be copied without modification [the MS-DOS(R)  |
  23. | utility DISKCOPY is appropriate for this purpose]; 3) All          |
  24. | components of this Application Note must be distributed together;  |
  25. | and 4) This Application Note may not be distributed for profit.    |
  26. |                                                                    |
  27. | Copyright 1992 Microsoft Corporation. All Rights Reserved.         |
  28. | Microsoft and MS-DOS are registered trademarks and Windows         |
  29. | is a trademark of Microsoft Corporation.                           |
  30. | IBM, Micro Channel, and PS/2 are registered trademarks of          |
  31. | International Business Machines Corporation.                       |
  32. | Logitech is a trademark of Logitech, Inc.                          |
  33.  --------------------------------------------------------------------
  34.  
  35.                              INTRODUCTION
  36.                              ============
  37.                                    
  38. This application note provides information about serial communications
  39. in the Microsoft Windows version 3.1 operating system environment. The
  40. first section, "What's New in Windows Version 3.1," gives an overview
  41. of improvements in Windows 3.1. The section "Conceptual Overview"
  42. explains basic and advanced concepts in serial communications,
  43. including port addresses, device contention, and so forth. The section
  44. "Why Conflicts Occur" discusses the most common reasons why you may
  45. experience difficulties with serial communications, and the section
  46. "How to Resolve Conflicts" explains what to do once you have
  47. identified the problem.
  48.  
  49. If you need help with a specific problem, you may want to start by
  50. reading the "Troubleshooting" section.
  51.  
  52. WHAT'S NEW IN WINDOWS VERSION 3.1
  53. =================================
  54.  
  55. Here are some highlights about improvements in how Windows 3.1 handles
  56. serial communications.
  57.  
  58. Performance Improvements
  59. ------------------------
  60.  
  61.  - Windows 3.1 supports the high-speed 16550AFN UART buffer; Windows
  62.    3.0 does not. (The 16550AFN buffer is supported for Windows-based
  63.    applications only.)
  64.  
  65.  - Windows 3.1 supports baud rates of up to 57.6K. (You may need to
  66.    update your application to take advantage of these higher baud
  67.    rates.) Some users experienced lockups during high-speed, full-
  68.    duplex transfers while using Windows 3.0. These problems are
  69.    resolved in Windows 3.1.
  70.  
  71.  - Windows 3.1 has a new serial driver interface that allows data to
  72.    be passed in blocks, instead of one character at a time. (Each
  73.    block is treated as a single character.) This means faster data
  74.    throughput and fewer transmission errors. Windows 3.0 passes data
  75.    one character at a time.
  76.  
  77.  - Windows 3.0 uses a "constant polling" method to determine when
  78.    serial ports are occupied. Windows 3.1 uses the
  79.    EnableCommNotification API; this enables applications to directly
  80.    notify Windows of serial events, thereby increasing overall system
  81.    performance.
  82.  
  83. Better Support for Your Ports
  84. -----------------------------
  85.  
  86.  - Windows 3.1 provides better support for COM ports 3 and 4. You can
  87.    now configure these ports by using Windows Control Panel.
  88.  
  89.  - Windows 3.1 fully supports IRQ sharing; Windows 3.0 does not. (To
  90.    take advantage of this feature, your PC must have Extended Industry
  91.    Standard Architecture (EISA) or Micro Channel(R) Architecture
  92.    (MCA), or you must have a serial I/O card that supports IRQ
  93.    sharing.)
  94.                                    
  95.                           CONCEPTUAL OVERVIEW
  96.                           ===================
  97.                                    
  98. This section provides a general introduction to the subject of serial
  99. communications and explains many of the concepts and issues that are
  100. discussed throughout the "Windows 3.1 and Serial Communications"
  101. application note.
  102.  
  103. SERIAL VS. PARALLEL PORTS
  104. =========================
  105.  
  106. Input/output (I/O) ports provide the means for your PC to send or
  107. receive data through external devices such as modems, printers, fax
  108. machines, and so forth. Virtually all PCs have both parallel and
  109. serial ports. There are several distinctions between serial and
  110. parallel I/O ports.
  111.  
  112. Parallel ports are generally used only for printers, which is where
  113. the name LPT, for line printer, originates. Parallel ports transmit
  114. data in complete bytes, and in most cases they handle outgoing data
  115. only; they cannot receive information. (The IBM[R] PS/2[R] parallel
  116. ports are bidirectional; in addition, you can use certain peripherals,
  117. such as network card adapters, to enable your ports to transmit data
  118. bidirectionally.) You do not configure parallel ports; they are
  119. preconfigured for your machine.
  120.  
  121. Serial ports are generally used for communications, or COM devices,
  122. which include serial printers, modems, fax machines, and so forth.
  123. Serial ports are capable of both sending and receiving data. You can
  124. configure settings--such as parity, stop bits, and data length--for
  125. your serial ports. (In Windows, you can specify these settings by
  126. using Control Panel.) Serial ports transmit data one bit at a time,
  127. sequentially (or serially).
  128.  
  129. PORT ADDRESSES AND IRQS
  130. =======================
  131.  
  132. Every time you start your PC, your system BIOS checks your COM ports
  133. to see what serial devices are installed on your PC and posts this
  134. information to the system BIOS data area (BDA). Windows "reads" the
  135. BDA, and uses the default interrupt request line (IRQ) for each device
  136. that is registered there. Usually, each COM port requires a unique IRQ
  137. to communicate with your PC. Certain PCs and some I/O cards support
  138. IRQ sharing.
  139.  
  140.   NOTE: Some earlier BIOS versions may not check for devices on COM
  141.   ports 3 and 4. If you have devices installed on COM port 3 or 4 and
  142.   your system BIOS does not recognize these ports, you need to
  143.   register the addresses for COM3 and COM4 by using Windows Control
  144.   Panel. This is explained in the procedure "To register a serial
  145.   device" later in this application note.
  146.  
  147. How Should My COM Ports Be Configured?
  148. --------------------------------------
  149.  
  150. Generally, PCs come with built-in ports COM1 and COM2 preset to the
  151. following values:
  152.  
  153.   Port       Address       IRQ
  154.   ----------------------------
  155.   COM1        03F8          4
  156.   COM2        02F8          3
  157.  
  158. In most cases, the default values for COM ports 1 and 2 should work
  159. for your system. You can view your COM port settings by using Windows
  160. Control Panel.
  161.  
  162. Most PCs do not have built-in ports for COM3 and COM4. The default
  163. settings for these additional ports are listed here:
  164.  
  165.   Port              Address        IRQ
  166.   ------------------------------------
  167.   COM3               03E8           4
  168.   COM3 (PS/2)        3220           3
  169.   COM4               02E8           3
  170.  
  171. Because COM1 and COM3 both use IRQ4 as the default, and COM2 and COM4
  172. both use IRQ3, you may need to reassign the IRQ if you use serial
  173. devices (such as a fax card or modem) on COM ports 3 or 4. You can
  174. reassign IRQs by using Control Panel. For more information, see the
  175. procedure "To reassign the IRQ" later in this application note. (You
  176. do not need to reassign the IRQ if you have an MCA or EISA machine, or
  177. a serial I/O card that supports IRQ sharing.)
  178.  
  179. 16550AFN UART CHIP SUPPORT
  180. ==========================
  181.  
  182. Every serial port uses a Universal Asynchronous Receiver-Transmitter
  183. (UART) chip to send and receive data. Inside your PC, data travels in
  184. parallel form. When you send or receive data by means of a serial
  185. device, the UART chip converts the data to a serial format so that
  186. your port can read it.
  187.  
  188. Many machines still use either the 8520 or the 16450 UART chip. The
  189. main advantage of the 16550AFN UART chip is its first in, first out
  190. (FIFO) buffering scheme, which can dramatically improve performance
  191. for modem transfer speeds of 9600 baud or higher. If you usually set
  192. your modem to 2400 or 1200 baud, chances are you don't need the
  193. 16550AFN UART.
  194.  
  195.   NOTE: The 16550, an earlier version of the chip, was used in IBM
  196.   PS/2 computers, models 50, 60, and 80, and replaced by the 16550AFN
  197.   in the PS/2 model 70. You may want to check with your manufacturer
  198.   to determine which version of the 16550 chip is installed in your
  199.   machine. The 16550 chip does not support FIFO buffering.
  200.  
  201. MS-DOS-BASED VS. WINDOWS-BASED APPLICATIONS
  202. ===========================================
  203.  
  204. Windows-based applications share a single time slice; each MS-DOS-
  205. based application running under Windows receives its own time slice. A
  206. time slice is the amount of processor time allocated to an
  207. application, usually measured in milliseconds. The smaller the time
  208. slice, the more efficiently Windows can run multiple tasks; therefore,
  209. in general, you will notice better performance with Windows-based
  210. applications running under Windows. You can also use "Windows-aware"
  211. software to emulate timeslice sharing for MS-DOS-based applications
  212. and thereby improve performance.
  213.  
  214. You run MS-DOS-based applications under Windows by writing PIF files
  215. that specify how you want Windows to schedule processor time for these
  216. applications. (For more information about PIF files, refer to Chapter
  217. 8, "PIF Editor," in the version 3.1 "Microsoft Windows User's Guide.")
  218.  
  219.                           WHY CONFLICTS OCCUR
  220.                           ===================
  221.                                    
  222. For serial communications to be successful, three settings must match:
  223. the port addresses in the BIOS data area, the COM port entries in the
  224. SYSTEM.INI file, and the switches on your serial hardware (if you have
  225. any installed). This section discusses the situations that can occur
  226. if these settings do not match, as well as other situations that can
  227. cause conflicts.
  228.  
  229. Determining whether these settings match, and changing them if they do
  230. not, is discussed in the section "How to Resolve Conflicts" later in
  231. this application note.
  232.  
  233. IRQ SHARING
  234. ===========
  235.  
  236. Many serial communications problems result from two devices attempting
  237. to use the same IRQ. For example, if you install a serial mouse on
  238. COM1 and a modem on COM3, both devices could attempt to use IRQ4 (the
  239. default setting) at the same time. Unless your PC supports IRQ sharing
  240. (the ability to have multiple ports using the same IRQ), this could
  241. cause your mouse or modem to lose functionality.
  242.  
  243. MCA and EISA machines support IRQ sharing. In addition, some
  244. serial I/O cards support IRQ sharing even if your machine is not
  245. specifically configured to do so. Windows 3.1 fully supports such
  246. serial I/O cards.
  247.  
  248. For more information, see the "IRQ Sharing" section under "How to
  249. Resolve Conflicts" later in this application note.
  250.  
  251. BIOS DATA AREA AND ADDRESS PACKING
  252. ==================================
  253.  
  254. There are four sequential spaces in the BDA for COM port addresses 1
  255. through 4. The BIOS lists port addresses so that no blank spaces occur
  256. between addresses. Windows reads the BDA sequentially and actually
  257. expects a blank address where there is no COM port. This can cause
  258. conflicts when Windows assigns IRQs.
  259.  
  260. For example, if you have a mouse on COM1, a printer on COM2, and a
  261. modem on COM4, Windows expects the BDA to look something like this:
  262.  
  263.                 (COM1)        (COM2)        (COM3)        (COM4)
  264.   0040:0000     F8  03        F8  02        00  00        E8  02
  265.  
  266. Because the BIOS does not use zeros as placeholders, however, the BDA
  267. actually looks something like this:
  268.  
  269.                 (COM1)        (COM2)        (COM3)        (COM4)
  270.   0040:0000     F8  03        F8  02        E8  02        00  00
  271.  
  272. This behavior is known as address packing, or address shifting.
  273. Windows assigns IRQs in the order that it finds a COM port address. In
  274. this situation, Windows would assign IRQ4 (the default for COM3) to
  275. the device that is actually on COM4. This could cause loss of
  276. functionality on COM4 because IRQ4 is already being used by COM1.
  277.  
  278. BIOS packing can affect COM ports 1 and 2 as well. For instance if you
  279. have no device on COM1, your COM2 address may register in the COM1
  280. BIOS area.
  281.  
  282. Whether or not you experience problems as a result of address packing
  283. may depend on what COM ports you are using, what type of hardware you
  284. have, and whether you are using MS-DOS-based communications software.
  285.  
  286. To correct this type of situation, you write a Debug script. A Debug
  287. script records the correct port addresses in your system memory. This
  288. procedure is described in the section "How to Resolve Conflicts" under
  289. '"Address Packing."
  290.  
  291. MS-DOS-BASED COMMUNICATIONS SOFTWARE AND WINDOWS 3.1
  292. ====================================================
  293.  
  294. MS-DOS-based applications and Windows-based applications handle serial
  295. communications in different ways. This section discusses guidelines
  296. for using your MS-DOS-based communications programs under Windows 3.1.
  297. For more information, see chapters 7, "Non-Windows Applications," and
  298. 8, "PIF Editor," in the version 3.1 "Microsoft Windows User's Guide."
  299.  
  300. General Guidelines
  301. ------------------
  302.  
  303. You use 386 enhanced mode Windows, and PIF files, to give Windows
  304. control of your MS-DOS-based communications applications. We don't
  305. recommend running MS-DOS-based communications applications in standard
  306. mode Windows, as this may cause data loss or other problems.
  307.  
  308. For better performance, run your MS-DOS-based applications in full-
  309. screen mode rather than in a window. If you run an MS-DOS-based
  310. communications application in the background during a data transfer,
  311. run it minimized as an icon rather than in a window.
  312.  
  313. PIF File Guidelines
  314. -------------------
  315.  
  316.  - Select the Background check box (under Execution in the main PIF
  317.    Editor dialog box), or your MS-DOS-based application will stop
  318.    running when you switch away from it.
  319.  
  320.  - Select the Lock Application Memory check box (in the PIF Editor
  321.    Advanced Options dialog box), or you may receive an error message.
  322.    (This setting applies only if you have a permanent swap file and 32-
  323.    bit disk access is enabled.)
  324.  
  325.  - If you encounter errors during data transfers, specify a larger
  326.    Background Priority or Foreground Priority setting (in the
  327.    Multitasking Options area of the Advanced Options dialog box).
  328.  
  329. Device Contention
  330. -----------------
  331.  
  332. In the Windows multitasking environment, two applications sometimes
  333. simultaneously request the use of a device (such as a COM port or
  334. modem). This is known as device contention. When you are running MS-
  335. DOS-based communications applications under Windows in 386 enhanced
  336. mode, you need to set device contention options in Control Panel.
  337. Doing so specifies how you want Windows to handle device requests from
  338. your MS-DOS-based applications.
  339.  
  340. Problems that can occur as a result of serial device contention
  341. include the inability to access a COM port. For more information, see
  342. the procedure "To set device contention options" later in this
  343. application note.
  344.  
  345. UART Support for MS-DOS-Based Applications
  346. ------------------------------------------
  347.  
  348. Windows 3.1 provides application support for the new 16550AFN UART
  349. buffer (see the section on the UART earlier in this application note).
  350. However, MS-DOS-based applications may not recognize the 16550AFN
  351. UART, treating it instead like the earlier 8250 version. This, in
  352. turn, may result in data loss. Whether you experience these problems
  353. also depends to a certain extent on your hardware manufacturer.
  354.  
  355. Bio-Engineering's TurboCom is an advanced serial port communications
  356. driver for Windows that provides UART support for MS-DOS-based
  357. applications running under Windows. TurboCom also supports IRQ sharing
  358. and baud rate speeds of up to 57.6K. If you regularly use MS-DOS-based
  359. communications software or software that requires a baud rate of 9600
  360. bits per second (bps) or higher, you may want to use the TurboCom
  361. driver. For additional information, contact your local dealer, or call
  362. Bio-Engineering Research Laboratories at (510) 540-8080.
  363.  
  364.   NOTE: If your communications software runs at 2400 baud or lower,
  365.   using the 16550AFN UART probably won't noticeably improve your
  366.   system's performance.
  367.  
  368. Address Packing and MS-DOS-Based Applications
  369. ---------------------------------------------
  370.  
  371. If Windows assigns an IRQ that is being used by an MS-DOS-based
  372. program, you may receive the message "The COM port is currently
  373. assigned to a DOS application. Do you want to reassign the port to
  374. Windows?"
  375.  
  376. The problem occurs when your machine BIOS packs addresses before
  377. posting them to the BDA. Windows reads the BDA sequentially, assigning
  378. the default IRQ for COM1 to the first entry it finds, the IRQ for COM2
  379. to the second entry, and so forth. For example, if you have a device
  380. on COM2 but not on COM1, and your system BIOS packs addresses, the
  381. COM2 address "shifts" into the BDA slot for COM1. Consequently,
  382. Windows assigns IRQ4 (the default for COM1) to the device that is
  383. actually on COM2.
  384.  
  385. MS-DOS-based communications programs access the COM ports directly,
  386. without posting their port address to the BDA. Using the same example,
  387. if you have no serial device on COM1, and your MS-DOS-based
  388. communication program is using COM2, the MS-DOS-based program still
  389. uses the default IRQ for COM2.
  390.  
  391. You can remedy this situation by writing a Debug script. For more
  392. information, see the procedure "To write a Debug script" later in this
  393. application note.
  394.  
  395. THIRD-PARTY COMMUNICATIONS DRIVERS
  396. ==================================
  397.  
  398. Some Windows-based third-party programs install their own drivers to
  399. replace the drivers provided by Windows. If these third-party drivers
  400. are installed in your system when you upgrade from Windows 3.0 to
  401. Windows 3.1, Setup does not install the Windows communications driver
  402. (COMM.DRV). In most instances, it is best to use the Windows 3.1
  403. driver, rather than a driver designed for Windows 3.0.
  404.  
  405. If you are experiencing driver problems (such as an inability to use
  406. higher baud rates, or problems accessing the modem), you can reinstall
  407. COMM.DRV or contact the manufacturer of your third-party driver for an
  408. update.
  409.  
  410. You can tell whether you have the Windows communications driver, or
  411. whether it has been replaced by the driver(s) that came with your
  412. communications software, by looking in your SYSTEM.INI file. See the
  413. procedure "To check for third-party drivers" later in this application
  414. note.
  415.  
  416.                        HOW TO RESOLVE CONFLICTS
  417.                        ========================
  418.                                    
  419. You should now be familiar with the most common reasons for serial
  420. communications problems in Windows 3.1. This section describes a few
  421. simple procedures you can follow to correct these problems.
  422.  
  423. RESOLVING IRQ CONFLICTS
  424. =======================
  425.  
  426. If you have serial devices on both COM1 and COM3, or COM2 and COM4,
  427. and your machine architecture does not support IRQ sharing, you need
  428. to reassign the IRQ for COM3 or COM4. (If you are using a serial card
  429. that supports IRQ sharing, read the section that follows this
  430. procedure.)
  431.  
  432. To properly reassign the IRQ:
  433.  
  434. 1. Determine the valid IRQ settings for the serial device by referring
  435.    to the manufacturer's documentation.
  436.  
  437.    Most serial devices such as I/O cards or internal modems can use
  438.    either of several valid IRQs. For example, a modem on COM3 may be
  439.    able to use IRQ5 if IRQ4 is not available.
  440.  
  441. 2. Determine which IRQs are available on your PC.
  442.  
  443.    You can do this by referring to the table provided below, or you
  444.    can use the Microsoft Diagnostic (MSD) utility. (Refer to the
  445.    procedure, "To use MSD to determine available IRQs" later in this
  446.    application note.) MSD is included with Windows version 3.1.
  447.  
  448. 3. Point both your serial device and Windows to the IRQ that you have
  449.    determined is valid and available.
  450.  
  451.    Set your serial device to the alternate IRQ by following the
  452.    directions in the manufacturer's documentation. Point Windows to
  453.    the alternate IRQ by using Control Panel to place an entry in your
  454.    SYSTEM.INI file.
  455.  
  456.     NOTE: Your serial device setting MUST match the COMxIRQ setting in
  457.     your SYSTEM.INI file. If these two settings do not match, the COM
  458.     port will not function properly.
  459.  
  460. Standard IRQ Settings (Table)
  461. -----------------------------
  462.  
  463. The following table shows the most common IRQ settings. You can use
  464. Control Panel to specify an IRQ from this table if it matches your
  465. hardware requirements. Or, if you'd like to view a table similar to
  466. this that lists the current settings in your PC, you can use MSD.
  467.   
  468.        IRQ Number       Description
  469.        ---------------------------------------     
  470.         0           Timer
  471.             1           Keyboard
  472.             2           Link to IRQs 8-15
  473.             3           COM2, COM4
  474.             4           COM1, COM3
  475.             5           LPT2, or Reserved
  476.             6           Floppy disk controller
  477.             7           LPT1, LPT3
  478.             8           Real time clock
  479.             9           Redirected IRQ2
  480.            10           Reserved
  481.            11           Reserved
  482.            12           PS/2 mouse
  483.            13           Math coprocessor
  484.            14           Hard disk controller
  485.            15           Reserved
  486.   
  487. The IRQs with "Reserved" entries in the corresponding Description
  488. column are often available. (This does not guarantee they are
  489. currently available on your PC.) You can use Control Panel to choose
  490. one of the "Reserved" IRQs, such as IRQ10, and then restart your
  491. system to see whether the COM port now works.
  492.  
  493.   NOTE: You must also change the hardware setting to the same IRQ. To
  494.   do this, follow the manufacturer's instructions.
  495.  
  496. If the first IRQ you choose does not work, you can try the next IRQ
  497. from this table, and so forth. If you do not have a PS/2 mouse port,
  498. you may be able to use IRQ12. Or, you can use MSD to view the IRQs
  499. that are actually available on your PC.
  500.  
  501. To Use MSD to Determine Available IRQs
  502. --------------------------------------
  503.  
  504. 1. Quit Windows.
  505.  
  506. 2. At the MS-DOS command prompt, type "msd"(without the quotation
  507.    marks).
  508.    
  509.    An initial screen appears, providing information about MSD. Choose
  510.    the OK button to view the MSD main menu.
  511.    
  512. 3. From the MSD main menu screen, choose the IRQ Status button.
  513.  
  514.    The IRQ Status screen shows which IRQs are currently assigned (not
  515.    available).
  516.  
  517. 4. Make a note of each IRQ number where the entry in the corresponding
  518.    Detected column reads No.
  519.  
  520.    A No entry in the Detected column indicates that the corresponding
  521.    IRQ is available. If you do not find a "No" entry in the Detected
  522.    column, there are no available IRQs, and you should not attempt to
  523.    reassign IRQs.
  524.  
  525. 5. Use Control Panel to assign one of the available IRQs to the COM
  526.    port whose IRQ you want to change.
  527.  
  528.    See the next procedure. You must also change the hardware setting
  529.    to the same IRQ. Follow the manufacturer's instructions.
  530.    
  531.   NOTE: Windows 3.1 does not support nonstandard IRQ settings. If your
  532.   serial communications device requires an IRQ that is different than
  533.   what is described in the MSD listing, we cannot guarantee the
  534.   results.
  535.  
  536. To Reassign the IRQ from Control Panel
  537. --------------------------------------
  538.  
  539. 1. In the Main group, choose the Control Panel icon.
  540.  
  541. 2. In the Control Panel window, choose the Ports icon.
  542.  
  543. 3. In the Ports dialog box, select the COM port for the device whose
  544.    IRQ you want to change, and then choose the Settings Button.
  545.  
  546. 4. In the Settings dialog box, choose the Advanced button.
  547.  
  548. 5. Open the Interrupt Request Line (IRQ) list box, and select a
  549.    number.
  550.  
  551.    This number must match your hardware setting.
  552.  
  553. 6. Choose the OK button twice to exit the settings dialog boxes, and
  554.    then choose the Close button to exit the Ports dialog box.
  555.  
  556. IRQ-Sharing Serial I/O Cards
  557. ----------------------------
  558.  
  559. If you are using an IRQ-sharing I/O card on a machine that does not
  560. have MCA or EISA architecture, you need to add the following line to
  561. the [386Enh] section of the SYSTEM.INI file:
  562.  
  563.    COMIrqSharing=TRUE
  564.  
  565.   NOTE: This setting does not, by itself, provide your system with IRQ-
  566.   sharing support. You must have the correct hardware configuration,
  567.   and the hardware must be installed according to the manufacturer's
  568.   specifications.
  569.  
  570. ADDRESS PACKING
  571. ===============
  572.  
  573. If you are using an MS-DOS-based communications program, Windows may
  574. assign an IRQ to a Windows serial device that is already in use by
  575. your MS-DOS-based program. If this happens, you may receive the error
  576. message "The COMx port is currently assigned to an MS-DOS application.
  577. Do you want to reassign the port to Windows?"
  578.  
  579. To remedy this situation, you need to familiarize yourself with the
  580. BDA. (This error message may also occur if you have a BIOS that does
  581. not search for serial devices on COM ports 3 or 4. If this is the
  582. case, you can use Control Panel to register the devices.)
  583.  
  584. To View the BDA by Using Debug
  585. ------------------------------
  586.  
  587. 1. Quit Windows.
  588.  
  589. 2. At the MS-DOS command prompt, type "debug" (without the quotation
  590.    marks), then press ENTER.
  591.  
  592.    A hyphen (-) prompt appears.
  593.  
  594. 3. Type "d40:0" (without the quotation marks), then press ENTER.
  595.    
  596.    This returns a listing of the BIOS data area (BDA). The first row
  597.    of the BDA shows the COM port and LPT port addresses, divided by a
  598.    center hyphen. COM ports are listed to the left of the hyphen; LPT
  599.    ports are listed to the right.
  600.    
  601. 4. Once you have interpreted the BDA (see the following procedure),
  602.    type "q" (without the quotation marks) to quit Debug.
  603.  
  604. To Interpret the BDA COM Address Entries
  605. ----------------------------------------
  606.  
  607. This table shows the four standard COM addresses as they should be
  608. listed in the BDA. (The COMx headings do not appear in the BDA.)
  609.    
  610.                 (COM1)        (COM2)        (COM3)        (COM4)
  611.   0040:000      F8  03        F8  02        E8  03        E8  02
  612.    
  613. If you have a serial device on COM port 3 or 4, and the BDA does not
  614. show an entry for the device, you can use Control Panel to register
  615. the device in the BDA. However, if the BDA shows any of the standard
  616. addresses in a location other than what is shown here (for example,
  617. address F8  02 in the space for COM1, or address E8  02 in the space
  618. for COM3), then you need to write a Debug script.
  619.  
  620.   NOTE: If you see an address in your BDA that is not shown here, your
  621.   hardware may use nonstandard serial port addresses. In this case you
  622.   need to register the nonstandard address by using Control Panel. See
  623.   the procedure "To register a serial device."
  624.  
  625. To Write a Debug Script
  626. -----------------------
  627.  
  628. 1. Open any standard text editor, such as Windows Notepad.
  629.  
  630. 2. Type the following three lines:
  631.  
  632.       E40:0
  633.       F8 03 F8 02 E8 03 E8 02
  634.       q
  635.    
  636.    You must press ENTER after typing "q" (without the quotation
  637.    marks). If you do not, the Debug script will cause your system to
  638.    remain indefinitely in Debug mode.
  639.  
  640. 3. Save the file as FIXCOM.DEB, or any filename with a .DEB extension.
  641.  
  642. 4. Add the following line to the end of your AUTOEXEC.BAT file:
  643.  
  644.       DEBUG < FIXCOM.DEB > NUL
  645.  
  646.    The "> NUL" ending keeps the Debug script from echoing to the
  647.    screen.
  648.    
  649.   NOTE: Do not place this entry after a program execution line, such
  650.   as WIN. If you do, the Debug script will not execute.
  651.    
  652. 5. Save your AUTOEXEC.BAT file and reboot your PC.
  653.  
  654. You can view the BDA again to see whether the address changes have
  655.    taken effect.
  656.  
  657.   NOTE: The port address setting on your physical serial device must
  658.   match what you specify in the Debug script. If your hardware
  659.   requires a nonstandard address, you can specify that address in the
  660.   Debug script.
  661.  
  662. SERIAL DEVICES ON COM3 AND COM4 DO NOT REGISTER
  663. ===============================================
  664.  
  665. Some earlier BIOS versions only recognize devices installed on COM
  666. ports 1 and 2. If your system BIOS does not recognize serial devices
  667. on COM ports 3 and 4, you can use Control Panel to notify Windows that
  668. you have devices installed at these locations. However, if your BIOS
  669. registers such devices but incorrectly records them at different
  670. addresses in the BDA (due to address shifting or packing), you cannot
  671. use Control Panel to correct this situation. Instead, you need to
  672. write a Debug script. Refer to the previous procedure.
  673.  
  674. To determine whether your system BIOS registers devices on COM port 3
  675. or 4, you need to read the BDA. Refer to the procedure "To view the
  676. BDA by using Debug."
  677.  
  678.   CAUTION: Setting the port address by using Control Panel does not
  679.   override a BDA value. What the BIOS reads replaces any entries you
  680.   make by using Control Panel, if there is a discrepancy between the
  681.   two. This procedure is not a substitute for writing a Debug script
  682.   if your BIOS incorrectly registers COM addresses.
  683.  
  684. To Register a Serial Device
  685. ---------------------------
  686.  
  687. 1. In the Main group, choose the Control Panel icon.
  688.  
  689. 2. In the Control Panel window, choose the Ports icon.
  690.  
  691. 3. In the Ports dialog box, select the port you want to identify to
  692.    Windows, and then choose the Settings button.
  693.  
  694. 4. In the Settings dialog box, choose the Advanced button.
  695.    
  696. 5. Open the Base I/O Port Address list box and select an address.
  697.    Check your hardware documentation for the appropriate value.
  698.  
  699. 6. Open the Interrupt Request Line (IRQ) list box, and select an IRQ.
  700.    Check your hardware documentation for the appropriate value.
  701.    
  702. Selecting values in this dialog box places COMxBase and COMxIRQ
  703. entries in your SYSTEM.INI file.
  704.  
  705. For more information on COMxBase and other SYSTEM.INI file entries,
  706. refer to the SYSINI.WRI file in your Windows directory.
  707.  
  708. DEVICE CONTENTION
  709. =================
  710.  
  711. You need to specify the device contention options for each MS-DOS-
  712. based communications application you are running under Windows.
  713.  
  714. To Set Device Contention Options
  715. --------------------------------
  716.  
  717. 1. In the Main group, choose the Control Panel icon.
  718.  
  719. 2. In the Control Panel window, choose the 386 Enhanced icon.
  720.  
  721. 3. Select the port that is connected to the device you want to
  722.    control.
  723.  
  724. 4. In the Device Contention group, select the option you prefer. Each
  725.    option is described below.
  726.  
  727.    Always Warn
  728.    
  729.    Select this option to have Windows display a dialog box whenever
  730.    more than one application requests use of a COM port at the same
  731.    time. The dialog box lets you specify which MS-DOS-based
  732.    application should receive control of the COM port. In most cases,
  733.    you should select Always Warn.
  734.    
  735.     NOTE: The Always Warn option does not replace IRQ sharing. When
  736.     you specify that one application receive control of a COM port,
  737.     the other application requesting to use the port is interrupted.
  738.     Optimally, once the first application completes its operation (for
  739.     example, a fax transmission), the COM port becomes available again
  740.     and the other application can resume. However, sometimes giving
  741.     control of a COM port to one application over another can
  742.     indefinitely hang the application that is required to wait.
  743.    
  744.    Never Warn
  745.    
  746.    When you select this option, Windows provides COM port access to MS-
  747.    DOS-based applications even if it detects that the requested port
  748.    may already be in use by another application.
  749.    
  750.    Selecting this option may cause unexpected problems, such as data
  751.    loss or an interruption during application processing.
  752.    
  753.    Idle (in sec.)
  754.  
  755.    Select this option to specify the number of seconds Windows should
  756.    wait before giving port access to an application without notifying
  757.    you. For instance, if you specify 10 seconds, Windows displays a
  758.    dialog box when any application requests the use of a port that was
  759.    occupied within the last 10 seconds. The dialog box lets you
  760.    specify which MS-DOS-based application should receive control of
  761.    the COM port. Otherwise, Windows provides COM port access without a
  762.    warning.
  763.  
  764. For more information about these options, see page 247 of Chapter 7,
  765. "Non-Windows Applications," in the version 3.1 "Microsoft Windows
  766. User's Guide."
  767.  
  768. THIRD-PARTY DRIVERS
  769. ===================
  770.  
  771. The Windows 3.1 Setup program updates many drivers that were included
  772. in Windows 3.0. Setup cannot update third-party drivers, however. You
  773. should obtain updates from the manufacturer for any third-party
  774. drivers that you are using under Windows 3.1.
  775.  
  776. To Check for Third-Party Communications Drivers
  777. -----------------------------------------------
  778.  
  779. 1. Open your SYSTEM.INI file by using any text editor, such as Windows
  780.    Notepad.
  781.  
  782. 2. Under the [boot] section, look for the following entry:
  783.  
  784.       comm.drv=comm.drv
  785.  
  786.    If this entry reads differently, then your system is using a third-
  787.    party Windows-level driver.
  788.  
  789. 3. Under the [386Enh] section, look for the following entries:
  790.  
  791.       device=*vcd
  792.       device=*combuff
  793.    
  794.    If either of these entries reads differently, or if there is an
  795.    additional entry, then your system is using third-party
  796.    communications drivers.
  797.  
  798. To determine whether you need an update, contact your manufacturer.
  799.  
  800. To use third-party drivers that have not been updated, you need to add
  801. the following line to the [386Enh] section of your SYSTEM.INI file:
  802.  
  803.    COMdrv30=TRUE
  804.  
  805. Once you obtain an update for your third-party driver, you can remove
  806. this entry from your SYSTEM.INI file.
  807.  
  808.               TROUBLESHOOTING COMMUNICATIONS PORT PROBLEMS
  809.               ============================================
  810.                                    
  811. This section can help you to identify what is causing a problem and
  812. then point you to the appropriate section in this application note for
  813. an explanation of how to resolve the problem.
  814.  
  815. COMMUNICATIONS APPLICATION CANNOT ACCESS A SERIAL PORT
  816. ======================================================
  817.  
  818. Are you using MS-DOS-based communications software? Refer to the "MS-
  819. DOS-Based Communications Software and Windows 3.1" section in this
  820. application note.
  821.  
  822. Related procedure:
  823. "To set device contention options"
  824.  
  825. Is the serial device using an available IRQ? Refer to the "Resolving
  826. IRQ Conflicts" section in this application note.
  827.  
  828. Related procedures:
  829. "To use MSD to determine available IRQs"
  830. "To reassign the IRQ from Control Panel"
  831.  
  832. PC LOCKS UP WHEN ACCESSING SERIAL PORT
  833. ======================================
  834.  
  835. Is the serial device using a unique IRQ? Refer to the "Resolving IRQ
  836. Conflicts" section in this application note.
  837.  
  838. Related procedures:
  839. "To use MSD to determine available IRQs"
  840. "To reassign the IRQ from Control Panel"
  841.  
  842. Is the serial device on COM4? Refer to the "Serial Devices on COM3 and
  843. COM4 Do Not Register" section.
  844.  
  845. Related procedure:
  846. "To register a serial device"
  847.  
  848. ERROR MESSAGES
  849. ==============
  850.  
  851. "The COM Port is Currently Assigned to a DOS Application..."
  852. ------------------------------------------------------------
  853.  
  854. If you receive this error message, refer to the procedure "To write a
  855. Debug script."
  856.  
  857. MODEM PROBLEMS
  858. ==============
  859.  
  860. Does your system BIOS recognize your internal modem? Refer to the
  861. "Address Packing and MS-DOS-Based Applications" section for
  862. information about reading the BDA.
  863.  
  864. Related Procedures
  865. "To view the BDA by using Debug"
  866. "To interpret the BDA COM address entries"
  867. "To register a serial device"
  868.  
  869. Do you have a modem on COM3 and a mouse on COM1, or a modem on COM4
  870. and a mouse on COM2? Unless your machine or serial I/O card supports
  871. IRQ sharing, this configuration is not recommended. Refer to the
  872. "Resolving IRQ Conflicts" section in this application note.
  873.  
  874. Related Procedure:
  875. "To reassign the IRQ from Control Panel"
  876.  
  877. Do you have an internal modem and a serial I/O card? Have you observed
  878. any of the following symptoms:
  879.  
  880.    The modem dials and rings but does not connect.
  881.    The system reboots when the modem attempts to dial out.
  882.    The system reboots when the modem should have connected.
  883.    The cursor does not work in Window Terminal.
  884.  
  885. If your internal modem uses a COM port that is addressed by your
  886. serial I/O card, you may experience IRQ conflicts. To correct this
  887. problem, disable the COM port setting on the serial I/O card. For
  888. example, if your internal modem is set to use COM2, and you have a
  889. serial I/O card that recognizes COM2, you may need to disable COM2 on
  890. the serial I/O card for the modem to work correctly.
  891.  
  892. MOUSE PROBLEMS
  893. ==============
  894.  
  895. General Guidelines
  896. ------------------
  897.  
  898. The mouse uses a different driver for MS-DOS-based applications than
  899. it does for Windows-based applications. In general, all mouse drivers
  900. should come from the same vendor. For example, do not use a Microsoft
  901. driver as the Windows mouse driver and a third-party driver as the MS-
  902. DOS mouse driver.
  903.  
  904. Do not install a modem on COM3 if you have a mouse on COM1, or a modem
  905. on COM4 if you have a mouse on COM2, unless your machine or serial I/O
  906. card supports IRQ sharing. Refer to the "Resolving IRQ Conflicts"
  907. section in this application note.
  908.  
  909. Mouse Doesn't Work in Enhanced Mode
  910. -----------------------------------
  911.  
  912. If your PC has no COM1 or if you have disabled COM1 and you have a
  913. mouse installed on COM2, you may experience problems using the mouse
  914. in 386 enhanced mode. Refer to the "BIOS Data Area and Address
  915. Packing" section in this application note.
  916.  
  917. Logitech(TM) Mouse
  918. ------------------
  919.  
  920. The Logitech virtual mouse driver (LVMD.386) is hard coded for the
  921. standard base port addresses and IRQs. If you use the Logitech mouse
  922. with a nondefault port address or IRQ, it may fail to work in 386
  923. enhanced mode.
  924.  
  925. 100%-Microsoft-Compatible Mouse
  926. -------------------------------
  927.  
  928. Any "100% Microsoft compatible" mouse that you purchase from your
  929. dealer is not interchangeable with the Microsoft mouse. If your 100%-
  930. Microsoft-compatible mouse comes with a driver disk that contains both
  931. Windows and MS-DOS mouse drivers, install these in place of the
  932. Microsoft mouse drivers. Installing such drivers places a new setting
  933. in the Mouse section of Windows Setup. After you install a 100%-
  934. Microsoft-compatible mouse, use Windows Setup to select your mouse
  935. type.
  936.  
  937. Microsoft Mouse
  938. ---------------
  939.  
  940. If you are using the Microsoft Mouse with Windows 3.1, make sure each
  941. of the following is true:
  942.  
  943.  - You are using version 8.2 or 8.2a of MOUSE.COM and MOUSE.SYS (the
  944.    mouse drivers for MS-DOS-based applications). Version 8.2 or 8.2a
  945.    of the driver is included with Windows 3.1.
  946.  
  947.  - MOUSE.DRV (the mouse driver for Windows-based applications) is in
  948.    the Windows SYSTEM subdirectory, is the only copy of this file on
  949.    your system, and is the most current version of the driver.
  950.  
  951.  - The mouse is assigned a unique IRQ (unless the serial port supports
  952.    IRQ sharing). For more information, see the "IRQ Sharing" section
  953.    in this application note.
  954.  
  955.  - The mouse is not installed on COM3 or COM4.
  956.  
  957. To see what version of the MS-DOS mouse driver you have
  958.  
  959. At the MS-DOS command line from the MS-DOS mouse directory (usually,
  960. MSMOUSE), type:
  961.  
  962.    mouse /?
  963.  
  964. To see what Windows mouse driver you are using
  965.  
  966. From the Main group, choose the Windows Setup icon. The mouse type
  967. should be "Microsoft, or IBM PS/2."
  968.  
  969. To change your Windows mouse driver
  970.  
  971. 1. In the Main group, choose the Windows Setup icon.
  972. 2. From the Options menu, choose Change System Settings.
  973. 3. Open the Mouse list box and select the type of mouse that you are
  974.    using.
  975. 4. Choose the OK button to close the dialog box.
  976.  
  977. COM4 PROBLEMS
  978. =============
  979.  
  980. If your communications software doesn't recognize a serial device on
  981. COM port 3 or 4, you may have a system BIOS that was manufactured
  982. before those COM ports became standard. Refer to the "Serial Devices
  983. on COM3 and COM4 Do Not Register" section earlier in this application
  984. note.
  985.  
  986. The COM4 default address of 02E8 conflicts with some peripheral
  987. devices, including the 8514/A, Ultra (ATI), and S3 (Orchid Fahrenheit
  988. 1280 STB WIND/X, Diamond Stealth VRAM) display adapters, and certain
  989. network adapters. Do not readdress COM4 in this situation. Contact
  990. your hardware manufacturer for information about how to reset the
  991. adapter's default address.
  992.  
  993. PROBLEMS RUNNING WINDOWS IN 386 ENHANCED MODE
  994. =============================================
  995.  
  996. Problems of this type may be related to a number of causes, including
  997. outdated driver files or IRQ conflicts. You can try the
  998. troubleshooting steps outlined below if you experience any of the
  999. following problems when trying to run Windows in 386 enhanced mode:
  1000.  
  1001.  -Windows stops running or returns to the MS-DOS prompt
  1002.  -General protection (GP) fault
  1003.  -Windows defaults to standard mode
  1004.  
  1005. If the steps outlined below do not help, then the problem is probably
  1006. not caused by a serial communications conflict. Refer to the Windows
  1007. Resource Kit for more information about problems running Windows in
  1008. 386 enhanced mode.
  1009.  
  1010. To Check for Outdated Driver Files
  1011. ----------------------------------
  1012.  
  1013. Before starting Windows from the MS-DOS prompt, change to the Windows
  1014. directory, and then start Windows.
  1015.    
  1016. If Windows runs in 386 enhanced mode only when you start it from the
  1017. Windows directory, you may have an outdated driver file in some other
  1018. directory. When Windows starts, it looks for the files it needs in the
  1019. following order:
  1020.    
  1021.    The current directory
  1022.    The Windows directory
  1023.    The Windows SYSTEM subdirectory
  1024.    All the directories listed in the PATH statement in the
  1025.    AUTOEXEC.BAT file
  1026.    All the directories in a network path
  1027.    
  1028. If you suspect that you have outdated driver files, you need to delete
  1029. them from your system.
  1030.    
  1031. To Delete Outdated Driver Files
  1032. -------------------------------
  1033.  
  1034. 1. Use File Manager to find all versions of the driver file(s) on your
  1035.    system. Compare each version by date.
  1036.  
  1037. 2. Delete all other versions of the driver file(s) except the most
  1038.    current version. Retain a single copy of the most current version
  1039.    in the Windows SYSTEM subdirectory.
  1040.  
  1041. To Identify an IRQ Conflict
  1042. ---------------------------
  1043.  
  1044. 1. Remove any serial hardware you have installed on your system
  1045.    (mouse, network card, fax board, modem, and so forth) and then
  1046.    restart Windows.
  1047.  
  1048.    If Windows now runs in 386 enhanced mode with no problems, the
  1049.    problem may be caused by an IRQ conflict.
  1050.  
  1051. 2. Reinstall each separate piece of serial hardware, one at a time,
  1052.    restarting Windows between each addition.
  1053.  
  1054.    This isolates the hardware that is causing the IRQ conflict. When
  1055.    the problem recurs, you can assume it is caused by the hardware you
  1056.    have just reinstalled.
  1057.  
  1058. 3. Reassign the IRQ for the piece of hardware in question.
  1059.  
  1060.    Refer to the procedure in this application note on "To reassign the
  1061.    IRQ from Control Panel."
  1062.  
  1063.